package com.cloud.dataway.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cloud.dataway.config.datasource.DBRouting;
import com.cloud.dataway.config.datasource.DbContextHolder;
import com.cloud.dataway.entity.UserEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yazhou
 * @since 2020-04-25
 */
//父接口BaseMapper中的方法，切换数据源不生效
@DBRouting(target = DbContextHolder.DataSource.SLAVE)
public interface UserSlaveMapper extends BaseMapper<UserEntity> {

    @Select({
            "select * from t_user"
    })
    List<UserEntity> selectList();
}
